﻿using System.Collections;
using System.Collections.Generic;
using System.Data;
using PMS.Utils;

namespace PMS.IServices
{
    public interface IBaseService<T> where T : class, new()
    {
        #region 公共方法

        /// <summary>
        /// 添加
        /// </summary>
        /// <ht name="user"></ht>
        /// <returns></returns>
        int Add(T user);

        /// <summary>
        /// 修改
        /// </summary>
        /// <ht name="user"></ht>
        /// <returns></returns>
        int Edit(T user);

        /// <summary>
        /// 获取单个实体
        /// </summary>
        /// <ht name="id"></ht>
        /// <returns></returns>
        T Dtl(int id);

        /// <summary>
        /// 判断是否存在
        /// </summary>
        /// <ht name="id"></ht>
        /// <returns></returns>
        bool IsExists(int id);

        /// <summary>
        /// 删除单个实体
        /// </summary>
        /// <ht name="id"></ht>
        /// <returns></returns>
        int Delete(int id, string deleteBy);

        /// <summary>
        /// 删除多个实体
        /// </summary>
        /// <ht name="ids"></ht>
        /// <returns></returns>
        int Delete(int[] ids, string deleteBy);

        /// <summary>
        /// 获取List
        /// </summary>
        /// <returns></returns>
        List<T> GetList();

        /// <summary>
        /// 根据条件获取数据
        /// </summary>
        /// <param name="ht"></param>
        /// <returns></returns>
        List<T> GetList(Hashtable ht);

        ///// <summary>
        ///// 获取List
        ///// </summary>
        ///// <ht name="ht">参数/值 键值对(参数)</ht>
        ///// <returns></returns>
        //List<T> GetList(Hashtable ht, QueryType type);

        ///// <summary>
        ///// 获取List家排序
        ///// </summary>
        //
        ///// <ht name="orderFiled">排序字段</ht>
        ///// <ht name="orderType">ASC 或者 DESC</ht>
        ///// <returns></returns>
        //List<T> GetList(string sqlText, string orderFiled, string orderType);

        ///// <summary>
        ///// 获取List家排序
        ///// </summary>
        //
        ///// <ht name="ht">参数/值 键值对(参数)</ht>
        ///// <ht name="orderFiled">排序字段</ht>
        ///// <ht name="orderType">ASC 或者 DESC</ht>
        ///// <returns></returns>
        //List<T> GetList(string sqlText, Hashtable ht, string orderFiled, string orderType);

        ///// <summary>
        ///// 获取List实体
        ///// </summary>
        //
        ///// <ht name="orderFiled">排序字段</ht>
        ///// <ht name="orderType">ASC 或者 DESC</ht>
        ///// <ht name="pageIndex">第几页</ht>
        ///// <ht name="pageSize">每页多少航</ht>
        ///// <ht name="count">out参数 总条数</ht>
        ///// <returns></returns>
        //List<T> GetList(string sqlText, string orderFiled, string orderType, int pageIndex, int pageSize,
        //    out int count);


        ///// <summary>
        ///// 获取List实体
        ///// </summary>
        //
        ///// <ht name="ht">参数/值 键值对(参数)</ht>
        ///// <ht name="orderFiled">排序字段</ht>
        ///// <ht name="orderType">ASC 或者 DESC</ht>
        ///// <ht name="pageIndex">第几页</ht>
        ///// <ht name="pageSize">每页多少航</ht>
        ///// <ht name="count">out参数 总条数</ht>
        ///// <returns></returns>
        //List<T> GetList(string sqlText, Hashtable ht, string orderFiled, string orderType, int pageIndex, int pageSize,
        //    out int count);

        #endregion

        #region 扩展方法



        #endregion
    }
}
